<?php defined('SYSPATH') or die('No direct script access.');

class Controller_Ajax_Login extends Controller{

public function action_index()
{
	if ($_POST)
    {
		$email = arr::get($_POST, 'email');
		$password = arr::get($_POST, 'password');
		$user = ORM::factory('user');
		$user->where('email', '=', $email)->find();
		if (!$user->loaded())
		{
			echo '该账户不存在';
			return;
		}
		if (Auth::instance()->login($email, $password))
		{
			echo '';
			return;
		}
		else
		{
			echo '密码错误';
		}
	}
}

}

